<template>
    <view style="height: 100%">
        <view :class="['list-scope', 'data-v-31ad2db6', 'list-' + grid]" v-if="wrapMode === 'wrap'">
            <block v-if="grid == 'row1'">
                <row1
                    @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                    @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                    :class="['data-v-31ad2db6', grid]"
                    :data-event-opts="[['^tap', [['clickItem']]]]"
                    :info="item"
                    theme="theme-1"
                    :vueId="'5f6e342e-1-' + index"
                    v-for="(item, index) in list"
                    :key="index"
                ></row1>
            </block>
            <block v-if="grid == 'grid1'">
                <grid1
                    @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                    @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                    :class="['data-v-31ad2db6', grid]"
                    :data-event-opts="[['^tap', [['clickItem']]]]"
                    :info="item"
                    theme="theme-1"
                    :vueId="'5f6e342e-2-' + index"
                    v-for="(item, index) in list"
                    :key="index"
                ></grid1>
            </block>
            <block v-else>
                <block v-if="grid == 'grid2'">
                    <grid2
                        @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                        @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                        :class="['data-v-31ad2db6', grid]"
                        :data-event-opts="[['^tap', [['clickItem']]]]"
                        :info="item"
                        :vueId="'5f6e342e-3-' + index"
                        v-for="(item, index) in list"
                        :key="index"
                    ></grid2>
                </block>
                <block v-else>
                    <block v-if="grid == 'grid3'">
                        <grid3
                            @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                            @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                            :class="['data-v-31ad2db6', grid]"
                            :data-event-opts="[['^tap', [['clickItem']]]]"
                            :info="item"
                            theme="theme-1"
                            :vueId="'5f6e342e-4-' + index"
                            v-for="(item, index) in list"
                            :key="index"
                        ></grid3>
                    </block>
                </block>
            </block>
        </view>
        <block v-else>
            <scroll-view :class="['scroll-list', 'data-v-31ad2db6', grid]" :scrollX="true" v-if="wrapMode === 'scroll'">
                <block v-if="grid == 'row1'">
                    <row1
                        @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                        @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                        :class="['data-v-31ad2db6', grid]"
                        :data-event-opts="[['^tap', [['clickItem']]]]"
                        :info="item"
                        theme="theme-1"
                        :vueId="'5f6e342e-5-' + index"
                        v-for="(item, index) in list"
                        :key="index"
                    ></row1>
                </block>
                <block v-if="grid == 'grid1'">
                    <grid1
                        @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                        @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                        :class="['data-v-31ad2db6', grid]"
                        :data-event-opts="[['^tap', [['clickItem']]]]"
                        :info="item"
                        theme="theme-1"
                        :vueId="'5f6e342e-6-' + index"
                        v-for="(item, index) in list"
                        :key="index"
                    ></grid1>
                </block>
                <block v-else>
                    <block v-if="grid == 'grid2'">
                        <grid2
                            @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                            @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                            :class="['data-v-31ad2db6', grid]"
                            :data-event-opts="[['^tap', [['clickItem']]]]"
                            :info="item"
                            :vueId="'5f6e342e-7-' + index"
                            v-for="(item, index) in list"
                            :key="index"
                        ></grid2>
                    </block>
                    <block v-else>
                        <block v-if="grid == 'grid3'">
                            <grid3
                                @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                                @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                                :class="['data-v-31ad2db6', grid]"
                                :data-event-opts="[['^tap', [['clickItem']]]]"
                                :info="item"
                                theme="theme-1"
                                :vueId="'5f6e342e-8-' + index"
                                v-for="(item, index) in list"
                                :key="index"
                            ></grid3>
                        </block>
                    </block>
                </block>
            </scroll-view>
        </block>
    </view>
</template>

<script>
import row1 from '@/components/BoxItem/Row1';
import grid1 from '@/components/BoxItem/Grid1';
import grid2 from '@/components/BoxItem/Grid2';
import grid3 from '@/components/BoxItem/Grid3';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/BoxList/BoxList'],
    {
        '256f': function (t, n, e) {
            'use strict';

            e.r(n);
            var o = e('9f3d');
            var i = e.n(o);
            for (var c in o) {
                if (['default'].indexOf(c) < 0) {
                    (function (t) {
                        e.d(n, t, function () {
                            return o[t];
                        });
                    })(c);
                }
            }
            n.default = i.a;
        },
        '64b0': function (t, n, e) {},
        '69b8': function (t, n, e) {
            'use strict';

            var o = e('64b0');
            e.n(o).a;
        },
        '9f3d': function (t, n, e) {
            'use strict';

            Object.defineProperty(n, '__esModule', {
                value: true
            });
            n.default = void 0;
            var o = {
                props: {
                    ids: {
                        type: Array
                    },
                    module: {
                        type: Object,
                        default: function () {
                            return {};
                        }
                    },
                    refreshCounter: Number,
                    getNextPageCounter: Number
                },
                components: {
                    Row1: function () {
                        e.e('components/BoxItem/Row1')
                            .then(
                                function () {
                                    return resolve(e('61e8'));
                                }.bind(null, e)
                            )
                            .catch(e.oe);
                    },
                    Grid1: function () {
                        e.e('components/BoxItem/Grid1')
                            .then(
                                function () {
                                    return resolve(e('666d'));
                                }.bind(null, e)
                            )
                            .catch(e.oe);
                    },
                    Grid2: function () {
                        e.e('components/BoxItem/Grid2')
                            .then(
                                function () {
                                    return resolve(e('5fa9'));
                                }.bind(null, e)
                            )
                            .catch(e.oe);
                    },
                    Grid3: function () {
                        e.e('components/BoxItem/Grid3')
                            .then(
                                function () {
                                    return resolve(e('bf34'));
                                }.bind(null, e)
                            )
                            .catch(e.oe);
                    }
                },
                data: function () {
                    return {
                        page: 1,
                        list: []
                    };
                },
                mounted: function () {
                    this.initData();
                },
                computed: {
                    isScroll: function () {
                        return 'scroll' == this.module.display;
                    },
                    grid: function () {
                        return this.module.grid || 'grid3';
                    },
                    wrapMode: function () {
                        return this.module.wrap_mode || 'wrap';
                    }
                },
                watch: {
                    ids: function () {
                        this.initData();
                    },
                    refreshCounter: function () {
                        this.initData();
                    },
                    getNextPageCounter: function (t) {
                        if ('all' === this.module.list_content) {
                            this.getNextPage();
                        }
                    }
                },
                methods: {
                    initData: function () {
                        var that = this;
                        if ('all' === this.module.list_content) {
                            this.page = 1;
                            this.$http('/boxes', 'GET', {
                                page: this.page,
                                per_page: 12
                            }).then(function (n) {
                                that.list = n.data.list;
                            });
                        } else {
                            if (this.ids && this.ids.length > 0) {
                                this.$http('/boxes', 'GET', {
                                    per_page: 100,
                                    ids: this.ids
                                }).then(function (n) {
                                    that.list = n.data.list;
                                });
                            }
                        }
                    },
                    clickItem: function () {
                        this.$playAudio('click');
                    },
                    getNextPage: function () {
                        var that = this;
                        this.page++;
                        this.$http('/boxes', 'GET', {
                            page: this.page,
                            per_page: 12
                        }).then(function (n) {
                            that.list = that.list.concat(n.data.list);
                        });
                    }
                }
            };
            n.default = o;
        },
        a640a: function (t, n, e) {
            'use strict';

            e.r(n);
            var o = e('f86c');
            var i = e('256f');
            for (var c in i) {
                if (['default'].indexOf(c) < 0) {
                    (function (t) {
                        e.d(n, t, function () {
                            return i[t];
                        });
                    })(c);
                }
            }
            e('69b8');
            var s = e('f0c5');
            var u = Object(s.a)(i.default, o.b, o.c, false, null, '31ad2db6', null, false, o.a, void 0);
            n.default = u.exports;
        },
        f86c: function (t, n, e) {
            'use strict';

            e.d(n, 'b', function () {
                return o;
            });
            e.d(n, 'c', function () {
                return i;
            });
            e.d(n, 'a', function () {});
            var o = function () {
                this.$createElement;
                this._self._c;
            };
            var i = [];
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/BoxList/BoxList-create-component',
    {
        'components/BoxList/BoxList-create-component': function (t, n, e) {
            e('543d').createComponent(e('a640a'));
        }
    },
    [['components/BoxList/BoxList-create-component']]
]);
</script>
<style>
@import './BoxList.css';
</style>
